<template>
  <el-drawer
    title="备案申请"
    :visible.sync="drawer"
    direction="rtl"
    :before-close="handleClose"
    size="1000px"
  >
    <div class="bock">
      <el-form
        ref="Form"
        :model="form_data"
        size="mini"
        label-position="right"
        label-width="120px"
        :rules="rules"
      >
        <el-collapse v-model="activeNames">
          <el-collapse-item title="基本信息" name="1">
            <el-col :span="12">
              <el-form-item label="性别" prop="PROCESS_NAME">
                <el-radio-group v-model="form_data.radio">
                  <el-radio :label="3">男</el-radio>
                  <el-radio :label="6">女</el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="真实姓名" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="请输入真实姓名"
                ></el-input>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="身份证号" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="请输入身份证号"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="联系方式" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="联系方式"
                ></el-input>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="户籍地址" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="省市县"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="户籍详细地址" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="户籍详细地址"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="居住地址" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="省市县"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="居住详细地址" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="居住详细地址"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="办公地址" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="省市县"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="办公详细地址" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="办公详细地址"
                ></el-input>
              </el-form-item>
            </el-col>
          </el-collapse-item>
          <el-collapse-item title="网络社交信息" name="2">
            <div>
              <el-table :data="tableData" style="width: 100%">
                <el-table-column
                  prop="name"
                  label="活跃平台"
                  width="120"
                ></el-table-column>
                <el-table-column
                  prop="name"
                  label="常用昵称"
                  width="120"
                ></el-table-column>
                <el-table-column
                  prop="name"
                  label="社交账号"
                  width="120"
                ></el-table-column>
                <el-table-column label="主播类型" width="120">
                  <template slot-scope="scope">
                    <el-select
                      v-model="scope.row.address"
                      size="small"
                      placeholder="请选择"
                    >
                      <el-option
                        v-for="item in options"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value"
                      >
                      </el-option>
                    </el-select>
                  </template>
                </el-table-column>
                <el-table-column
                  prop="name"
                  label="粉丝总量（万）"
                  width="120"
                ></el-table-column>
                <el-table-column
                  prop="name"
                  label="主页链接"
                  width="120"
                ></el-table-column>

                <el-table-column label="主涉领域" width="120">
                  <template slot-scope="scope">
                    <el-input v-model="scope.row.age" size="small"></el-input>
                  </template>
                </el-table-column>
                <el-table-column label="作品类别" width="120">
                  <template slot-scope="scope">
                    <el-input v-model="scope.row.age" size="small"></el-input>
                  </template>
                </el-table-column>
                <el-table-column
                  prop="name"
                  label="所属MCN机构"
                  width="120"
                ></el-table-column>
                <el-table-column
                  prop="name"
                  label="合作推广营销结构"
                  width="120"
                ></el-table-column>
                <el-table-column fixed="right" label="操作" width="100">
                  <template slot-scope="scope">
                    <el-button type="text" size="small">删除</el-button>
                  </template>
                </el-table-column>
              </el-table>
              <div class="addTable">
                <i class="el-icon-plus"></i>
                添加
              </div>
            </div>
          </el-collapse-item>
          <el-collapse-item title="其他" name="3">
            <el-col :span="24">
              <el-form-item label="备注" prop="PROCESS_NAME">
                <el-input
                  v-model="form_data.PROCESS_NAME"
                  placeholder="备注"
                  type="textarea"
                ></el-input>
              </el-form-item>
            </el-col>
          </el-collapse-item>
        </el-collapse>
      </el-form>
    </div>
    <div class="drawerBtn">
      <el-button size="mini">取 消</el-button>
      <el-button size="mini" type="primary" @click="submit">确 认</el-button>
      <el-button size="mini" type="primary">暂 存</el-button>
    </div>
  </el-drawer>
</template>
<script>
export default {
  data() {
    return {
      drawer: false,
      activeNames: "1",
      form_data: {
        EVALUATE: "",
        PROCESS_NAME: "",
      },
      tableData: [
        { name: "张三", age: 28, address: "" },
        { name: "李四", age: 22, address: "" },
        // 更多数据...
      ],
      rules: {
        EVALUATE: [
          { required: true, message: "请输入评价", trigger: "blur" },
          {
            min: 1,
            max: 100,
            message: "长度在 1 到 100 个字符",
            trigger: "blur",
          },
        ],
      },
    };
  },
  methods: {
    isShow() {
      this.drawer = true;
    },
    handleRemove(file, fileList) {
      console.log(file, fileList);
    },
    handlePreview(file) {
      console.log(file);
    },

    submit() {
      this.$refs["Form"].validate((valid) => {
        if (valid) {
          let data = {
            MOR_BEHA_EVALUATE: this.form_data.EVALUATE,
            EVALUATION_SCORE_ID: this.data.EVALUATION_SCORE_ID,
          };
          this.loading = true;
          addEvaluate(data)
            .then((res) => {
              this.$message.success("评价成功");
              this.loading = false;
              this.$emit("submit");
              this.show = false;
            })
            .catch(() => {});
        } else {
          return false;
        }
      });
    },
    handleClose() {
      this.drawer = false;
    },
  },
};
</script>
<style scoped>
.bock {
  padding: 0px 20px;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
}
.addTable {
  width: 100%;
  margin: 20px 0;
  padding: 4px 0;
  text-align: center;
  border-radius: 4px;
  color: #3c94f4;
  border: 1px solid #3c94f4;
}
</style>